/**
 * JAVACC DEMO 1.0
 * @copy right iussoft company All rights reserved.
 * @Package com.apache.audit.client  
 */
package com.apache.passport.aop;

import com.apache.database.constant.Validator;
import com.apache.method.SystemRunnable;
import com.apache.method.ThreadPool;

/**
 * description:  线程池,用于管理多线程方法后操作
 * @Copyright(c)2014:
 */
public class PassportTheardPool {

	private static PassportTheardPool instance;
	private ThreadPool taskPool;

	private PassportTheardPool() {
		taskPool = new ThreadPool(3, "Passport执行线程池");
	}

	public synchronized static PassportTheardPool getInstance() {
		if (null == instance)
			instance = new PassportTheardPool();
		return instance;
	}

	public void saveLogger(SystemRunnable runnable) {
		if (!Validator.isEmpty(runnable)) {
			taskPool.execute(runnable);
		}
	}
}
